package com.pe1n.yangtaopai.adapter;

import android.content.Context;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.jude.rollviewpager.RollPagerView;
import com.jude.rollviewpager.adapter.LoopPagerAdapter;
import com.pe1n.yangtaopai.R;
import com.pe1n.yangtaopai.bean.ListBean;


import java.util.List;

/**
 * Created by Administrator on 2016/11/24.
 */
public class MyAmountItemOneRollViewPagerAdapter extends LoopPagerAdapter{
    private Context mContext;
    private List<ListBean.DataBean>listonebean;

    public MyAmountItemOneRollViewPagerAdapter(RollPagerView viewPager, Context mContext, List<ListBean.DataBean>listonebean) {
        super(viewPager);
        this.mContext = mContext;
        this.listonebean = listonebean;
    }

    @Override
    public View getView(ViewGroup container, int position) {
        ImageView imageView=new ImageView(mContext);
        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
        imageView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
        Glide.with(mContext).load(listonebean.get(position).getImagePath()).placeholder(R.drawable.place_holder).into(imageView);
        Log.e("tag",listonebean.get(position).getImagePath());

        return imageView;

    }

    @Override
    public int getRealCount() {
        return listonebean.size();
    }
}
